package com.test.study.reflect;

import java.util.Arrays;
import java.util.stream.Collectors;

public class User {
    private String username;
    private String sex;
    private int age;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String sayHello(String msg){
        return  "hello "+msg;
    }

    public User(String username) {
        this.username = username;
    }
    public  User(){}

    public static String testStatis(String str){
        System.out.println("static method test"+str);
        return "static test";
    }
    public static void sum(int... args){
        int sum = Arrays.stream(args).sum();
        System.out.println(sum);
    }
    public static void sum(Integer... args){
        int sum=0;
        for (Integer arg : args) {
            sum+=arg;
        }
        System.out.println(sum);
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
